<script setup lang="ts">
import { NMessageProvider } from 'naive-ui'
import AppleHeader from './components/AppleHeader.vue'

// Get window controls from electron
const ipcRenderer = window.ipcRenderer

const handleClose = () => {
  ipcRenderer?.send('window-close')
}

const handleMinimize = () => {
  ipcRenderer?.send('window-minimize')
}

const handleMaximize = () => {
  ipcRenderer?.send('window-maximize')
}
</script>

<template>
  <div class="h-screen flex flex-col">
    <AppleHeader
      title="TiTodo"
      @close="handleClose"
      @minimize="handleMinimize"
      @maximize="handleMaximize"
    />
    <n-message-provider>
      <main class="flex-1 overflow-auto">
        <router-view></router-view>
      </main>
    </n-message-provider>
  </div>
</template>
